package com.arvato.wxwork.service.member;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.arvato.minipro.bean.bean_dto.common.Query;
import com.arvato.wxwork.bean.bean_do.member.WxworkPhoneBookGroupDo;
import com.arvato.wxwork.bean.bean_vo.member.WxworkPhoneBookGroupVo;
import com.arvato.wxwork.mapper.member.WxworkPhoneBookGroupMapper;

/**
 * 客户分组service
 * @author ZHAN655
 *
 */
@Service
@Transactional
public class WxworkPoneBookGroupService {
	
	@Autowired
	private WxworkPhoneBookGroupMapper wxworkPhoneBookGroupMapper;
	
	/**
	 * 条件查询
	 * @param query
	 * @return
	 */
	public List<WxworkPhoneBookGroupVo> listGroupByQuery(Query query) {
		List<WxworkPhoneBookGroupVo> groupList = wxworkPhoneBookGroupMapper.listGroupByQuery(query);
		return groupList;
	}
	
	/**
	 * 新增分组
	 * @param dto
	 * @return
	 */
	public int insert(WxworkPhoneBookGroupDo dto) {
		return 	wxworkPhoneBookGroupMapper.insert(dto);
	}

	/**
	 * 更新分组
	 * @param dto
	 * @return
	 */
	public int update(WxworkPhoneBookGroupDo dto) {
		return 	wxworkPhoneBookGroupMapper.update(dto);
	}
	
	/**
	 * 删除分子
	 * @param id
	 * @return
	 */
	public int delete(String id) {
		return 	wxworkPhoneBookGroupMapper.delete(id);
	}
}
